package com.itheima.day08.mySet.test1;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class Test {
    public static void main(String[] args) {
        Set<String> set = new TreeSet<>();
        set.add("bbb");
        set.add("ddd");
        set.add("aaa");
        set.add("aaa");
        set.add("ccc");

        Iterator<String> it = set.iterator();
        while(it.hasNext()){
            System.out.print(it.next() + " ");
        }
        System.out.println("\n----------------------------");
        for (String s : set) {
            System.out.print(s + " ");
        }

    }
}
